
#include "iostream"
#include "vector"
#include "unordered_map"
#include "algorithm"
#include "string"
#include "list"
class Solution{
public:
};


int main() {
//    std::list<int> list1;
//    int c=0;int b=0;
////    bool first= true;
    while(1){
        std::string s1,s2;
        if(std::getline(std::cin,s1)){
        }else{
            break;
        }
        std::getline(std::cin,s2);
//        if(!first){
//            printf("\n");
//        }
//        first= false;
        printf("in s1 or s2:");
        for(char a='a';a<='z';a++){
            if(s1.find(a)!=-1||s2.find(a)!=-1){
                printf("%c",a);
            }
        }
        printf("\nin s1 and s2:");
        for(char a='a';a<='z';a++){
            if(s1.find(a)!=-1&&s2.find(a)!=-1){
                printf("%c",a);
            }
        }
        printf("\nin s1 but not in s2 ,or in s2 but not in s1:");
        for(char a='a';a<='z';a++){
            if((s1.find(a)!=-1&&s2.find(a)==-1)
            ||(s2.find(a)!=-1&&s1.find(a)==-1)
            ){
                printf("%c",a);
            }
        }
        printf("\nnot in s1 and s2:");
        for(char a='a';a<='z';a++){
            if((s1.find(a)==-1&&s2.find(a)==-1)
            ){
                printf("%c",a);
            }
        }
        printf("\n\n");
    }
    return 0;
}

